﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_COM_USER_MGT_Search_User_Info')
	BEGIN
		DROP Procedure usp_UPDMS_COM_USER_MGT_Search_User_Info
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_COM_USER_MGT_Search_User_Info
**	Desc : 인원검색 (인원검색 팝업에서 호출)
**	Test Exec Query : Exec usp_UPDMS_COM_USER_MGT_Search_User_Info 'relic4160','','','Y','ko'
**	Called by : Com_Dac_UPDMS_COM_USER_MGT.cs
**	Program ID : Com3015p
**	Auth : 송시명
**	Date : 2013-06-20
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_COM_USER_MGT_Search_User_Info]
@ls_user_id nvarchar(20),
@ls_nm nvarchar(50),
@ls_email nvarchar(200),
@ls_use_yn nvarchar(1),
@ls_lang_cd nvarchar(2)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

SELECT ucum.User_Id,
       ucum.Nm,
       ucum.Email,
       ucum.User_Level,
       CASE @ls_lang_cd WHEN 'ko' THEN ucc.Value1
                        ELSE ucc.Value2
       END User_Div_Nm
  FROM UPDMS_COM_USER_MGT AS ucum WITH(NOLOCK)
  JOIN UPDMS_COM_CD AS ucc WITH(NOLOCK) ON ucum.User_Div = ucc.Cd AND ucc.Id = 'COM'
 WHERE ucum.User_Id LIKE '%' + @ls_user_id + '%'
   AND ucum.Nm LIKE '%' + @ls_nm + '%'
   AND ucum.Email LIKE '%' + @ls_email + '%'
   AND ucum.Use_Yn LIKE @ls_use_yn + '%'
   
GO